package cn.com.ry.framework.mongodb.sync.util;

import cn.com.ry.framework.mongodb.sync.service.SynService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.concurrent.BlockingQueue;

@Component
public class Producer implements Runnable {
    @Autowired
    private SynService synService;

    protected BlockingQueue queue = null;

    public void setProducer(BlockingQueue queue) {
        this.queue = queue;
    }


    public void run() {
        synService.addTask(queue);
    }
}

